package com.njym.java.security.app.rest;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.njym.java.security.app.biz.ProvinceBiz;
import com.njym.java.security.app.entity.Province;
import com.njym.java.security.app.entity.TravelHero;
import com.njym.java.security.common.rest.BaseController;
import com.njym.java.security.common.util.ResponseUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import tk.mybatis.mapper.entity.Example;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("province")
public class ProvinceController extends BaseController<ProvinceBiz,Province> {

    @RequestMapping(value = "/getList", method = RequestMethod.GET)
    @ResponseBody
    public Object getList(){
        Example example = new Example(Province.class);
        List<Province> list = baseBiz.selectByExample(example);


        Map<String, Object> data = new HashMap<>(3);
        data.put("list", list);

        return ResponseUtil.ok(data);
    }
}